package com.guan.eduservice.client;

import com.guan.commonutils.R;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @Date: 2023/3/9 11:44
 * @Author: 管奇安
 * @Description:
 *  当调用该接口的方法时，该接口会根据@FeignClient("service-vod")
 *  远程调用@DeleteMapping("/eduvod/video/removeAliyunVideo/{id}")对应的接口方法
 *
 */
@Component
//远程调用接口 调用的服务器名称 spring.application.name=service-vod, fallback指向实现类
@FeignClient(name = "service-vod",fallback = VodClientImpl.class)
public interface VodClient {

    /*
     * @date: 2023/3/9 11:48
     * @author: 管奇安
     * @description: 定义调用的方法路径，请求路径要写全
     * @param: [id]
     * @return: com.guan.commonutils.R
     **/
    @DeleteMapping("/eduvod/video/removeAliyunVideo/{id}")
    public R removeAliyunVideo(@PathVariable("id") String id);


    /*
     * @date: 2023/3/9 11:51
     * @author: 管奇安
     * @description: 批量删除视频
     * @param: [videoIdList]
     * @return: com.guan.commonutils.R
     **/
    @DeleteMapping("/eduvod/video/delete-batch")
    public R deleteBatch(@RequestParam("videoIdList") List<String> videoIdList);



}
